# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>

_pyname=jupyter_client
pkgname=python-${_pyname/_/-}
pkgver=8.2.0
pkgrel=2
pkgdesc='Jupyter protocol implementation and client libraries'
arch=(any)
url='https://pypi.python.org/pypi/jupyter_client'
license=(BSD)
depends=(python-ipykernel python-traitlets python-pyzmq python-jupyter-core python-dateutil python-entrypoints)
makedepends=(python-build python-installer python-hatchling)
checkdepends=(python-pytest-jupyter python-pytest-timeout iproute2 net-tools openssh)
conflicts=(python-jupyter_client)
provides=(python-jupyter_client)
replaces=(python-jupyter_client)
source=(https://files.pythonhosted.org/packages/source/j/jupyter_client/jupyter_client-$pkgver.tar.gz)
sha256sums=('9fe233834edd0e6c0aa5f05ca2ab4bdea1842bfd2d8a932878212fc5301ddaf0')

build() {
  cd $_pyname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pyname-$pkgver
  pytest -v
}

package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
